<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>商家管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" type="text/css" href="/css/plugins/dropzone/basic.css"/>
    <link rel="stylesheet" type="text/css" href="/css/plugins/dropzone/dropzone.css"/>
    <link rel="stylesheet" type="text/css" href="/css/plugins/layui-formSelect/formSelects-v4.css"/>
    <style>
        img {
            margin-left: 5px
        }
        tr td {
            text-align: center !important;
        }
        .layui-table img {
            width: auto;
            height: auto;
            max-width: 100% !important;
            max-height: 100%;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md-12" style="background-color: #fff;height: 2000px">
            <div class="layui-col-md9 layui-col-md-offset1" style="border: 1px solid #ccc;border-radius: 3px;margin-left: 12%">
                <div class="layui-card">
                    <div class="layui-card-header" style="text-align: center;font-weight: bold;color: #0a6aa1">如需变更资料，请联系平台变更！</div>
                    <div class="layui-card-header" style="text-align: center;font-weight: bold;background-color:#FDF5E6">店铺信息</div>
                    <div class="layui-card-body layui-text">
                        <table class="layui-table">
                            <colgroup>
                                <col width="200">
                                <col>
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>经营范围</td>
                                <td>
                                    <c:if test="${business.onOff==0}">线上</c:if>
                                    <c:if test="${business.onOff==1}">线下</c:if>
                                    <c:if test="${business.onOff==2}">全部</c:if>
                                </td>
                            </tr>
                            <tr>
                                <td>店铺类型</td>
                                <td>${scope}</td>
                            </tr>
                            <c:if test="${business.onOff == 0 || business.onOff == 2}">
                                <tr>
                                    <td>线上店铺名称</td>
                                    <td>${business.nickNameOn}</td>
                                </tr>
                            </c:if>
                            <c:if test="${business.onOff == 1 || business.onOff == 2}">
                                <tr>
                                    <td>线下店铺名称</td>
                                    <td>${business.nickName}</td>
                                </tr>
                            </c:if>
                            <tr>
                                <td>企业名称</td>
                                <td>${business.companyName}</td>
                            </tr>
                            <tr>
                                <td>法人姓名</td>
                                <td>${business.realName}</td>
                            </tr>
                            <tr>
                                <td>联系电话</td>
                                <td>${business.phone}</td>
                            </tr>
                            <tr>
                                <td>线下店铺联系电话</td>
                                <td>${business.linkPhone}</td>
                            </tr>
                            <tr>
                                <td>营业执照号码</td>
                                <td>${business.licenseCode}</td>
                            </tr>
                            <tr>
                                <td>行业类型</td>
                                <td>${industryName}</td>
                            </tr>
                            <tr>
                                <td>店铺地址</td>
                                <td>${addrName}</td>
                            </tr>
                            <tr>
                                <td>消费者保障权益</td>
                                <c:if test="${business.guarantee==0}">
                                    <td>
                                        <button class="layui-btn layui-btn-xs layui-btn-warm" onclick="applyGuarantee()">申请</button>
                                    </td>
                                </c:if>
                                <c:if test="${business.guarantee==1}">
                                    <td><span class="layui-badge layui-bg-green">已申请</span></td>
                                </c:if>
                                <c:if test="${business.guarantee==2}">
                                    <td><span class="layui-badge layui-bg-gray">申请中</span></td>
                                </c:if>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="layui-card">
                    <div class="layui-card-header" style="text-align: center;font-weight: bold;background-color:#FDF5E6">店铺资料</div>
                    <div class="layui-card-body layui-text">
                        <table class="layui-table">
                            <colgroup>
                                <col width="200">
                                <col>
                            </colgroup>
                            <tbody>
                            <c:if test="${business.onOff == 0 || business.onOff == 2}">
                                <tr>
                                    <td>线上LOGO</td>
                                    <td>
                                        <img src="${business.logo}">
                                    </td>
                                </tr>
                            </c:if>
                            <c:if test="${business.onOff == 1 || business.onOff == 2}">
                                <tr>
                                    <td>线下店铺头像</td>
                                    <td>
                                        <img src="${business.headUrl}">
                                    </td>
                                </tr>
                            </c:if>
                            <tr>
                                <td>法人证件照</td>
                                <td>
                                    <img src="${business.cardFileFront}" style="width: 300px;height: 200px">
                                    <img src="${business.cardFileBack}" style="width: 300px;height: 200px">
                                </td>
                            </tr>
                            <tr>
                                <td>营业执照</td>
                                <td>
                                    <img src="${business.busLicense}" style="width: 300px;height: 200px">
                                </td>
                            </tr>
                            <tr>
                                <td>其它执照</td>
                                <td style="margin: 5px">
                                    <img src="${business.license1}" style="width: 300px;height: 200px">
                                    <img src="${business.license1}" style="width: 300px;height: 200px">
                                    <img src="${business.license1}" style="width: 300px;height: 200px">
                                </td>
                            </tr>
                            <c:if test="${business.onOff == 1 || business.onOff == 2}">
                                <tr>
                                    <td>店铺门头照</td>
                                    <td>
                                        <c:forEach items="${business.coverUrlList}" var="a">
                                            <img src="${a}" style="width: 100px;height: 100px">
                                        </c:forEach>
                                    </td>
                                </tr>
                            </c:if>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="/layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index'], function () {
        var rate = layui.rate;
    });

    function applyGuarantee(){
        layer.confirm('确定申请吗？', function(){
            $.ajax({
                url: '/business/applyGuarantee',
                data: {"guarantee": 2},
                dataType: "json",
                type: "post",
                success: function (data) {
                    if (data.status) {
                        layer.msg('已提交申请，请等待平台审核！',{icon:1});
                        setTimeout(function () {
                            window.location.reload();
                        }, 1000)
                    } else {
                        layer.msg("提交申请失败，请重试！",{icon:2});
                    }
                }
            });
        });
    }
</script>
</body>
</html>